package com.example.demo.order.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 订单表;
 * </p>
 *
 * @author 涛
 * @since 2024-08-01
 */
@Data
public class OOrderManage implements Serializable {

    private static final long serialVersionUID=1L;

    /**
     * id
     */
    @TableId(value = "ID", type = IdType.AUTO)
    private Integer id;

    /**
     * 下单人;外键关联用户表
     */
    @TableField("UID")
    private String uid;

    /**
     * 下单预约时间
     */
    @TableField("ORDER_DATE")
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    private LocalDateTime orderDate;

    /**
     * 服务人员;外键关联服务人员表
     */
    @TableField("SERVICE_STAFF")
    private String serviceStaff;

    /**
     * 支付方式
     */
    @TableField("PAY_METHOD")
    private String payMethod;

    /**
     * 地址编号
     */
    @TableField("ADDRESS")
    private String address;

    /**
     * 备注
     */
    @TableField("COMMENT")
    private String comment;

    /**
     * 订单内容
     */
    @TableField("ORDER_CONTENT")
    private String orderContent;

    /**
     * 打车费
     */
    @TableField("TAXI_FARE")
    private String taxiFare;

    /**
     * 卡券ID;外键关联卡卷管理表
     */
    @TableField("CARD_ID")
    private String cardId;

    /**
     * 优惠总额
     */
    @TableField("DISCOUNT_AMOUNT")
    private String discountAmount;

    /**
     * 订单总额
     */
    @TableField("AMOUNT")
    private String amount;

    /**
     * 订单状态
     */
    @TableField("ORDER_STATUS")
    private String ORDER_STATUS;

    /**
     * 订单编号
     */
    @TableField("ORDER_NO")
    private String ORDER_NO;

    /**
     * 实际支付
     */
    @TableField("REAL_PAY")
    private String realPay;

    /**
     * 平台服务费
     */
    @TableField("SERVICE_AMOUNT")
    private String serviceAmount;

    /**
     * 订单已读标识
     */
    @TableField("ORDER_READ_FLAG")
    private String orderReadFlag;

    /**
     * 创建人
     */
    @TableField("CREATED_BY")
    private String createdBy;

    /**
     * 创建时间
     */
    @TableField(value="CREATED_TIME",fill = FieldFill.INSERT)
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    private LocalDateTime createdTime;

    /**
     * 更新人
     */
    @TableField("UPDATED_BY")
    private String updatedBy;

    /**
     * 更新时间
     */
    @TableField(value="UPDATED_TIME",fill = FieldFill.UPDATE)
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    private LocalDateTime updatedTime;

    @Override
    public String toString() {
        return "OOrderManage{" +
        "id=" + id +
        ", uid=" + uid +
        ", orderDate=" + orderDate +
        ", serviceStaff=" + serviceStaff +
        ", payMethod=" + payMethod +
        ", address=" + address +
        ", comment=" + comment +
        ", orderContent=" + orderContent +
        ", taxiFare=" + taxiFare +
        ", cardId=" + cardId +
        ", discountAmount=" + discountAmount +
        ", amount=" + amount +
        ", realPay=" + realPay +
        ", serviceAmount=" + serviceAmount +
        ", createdBy=" + createdBy +
        ", createdTime=" + createdTime +
        ", updatedBy=" + updatedBy +
        ", updatedTime=" + updatedTime +
        "}";
    }

    //今日进行中订单数量
    private Integer todayOrderCount;

    //新订单数量
    private Integer orderReadFlagCount;

    //待服务订单数量
    private Integer orderWillCount;

    //总订单数量
    private Integer orderTotalCount;

    //好评分
    private String goodRating;

    //好评率
    private String praiseRate;
}
